import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from '@cool-midway/core';
import { Column } from 'typeorm';

/**
 * 字典类型表
 */
@EntityModel('magic_cate')
// @Index('dict_unique', ['targetId'], { unique: true })
export class MagicCateEntity extends BaseEntity {
  @Column({ comment: '名称', type: 'varchar', nullable: true })
  name: string;

  @Column({
    name: 'target_id',
    comment: '目标id,对应魔法页面id',
    nullable: true,
  })
  targetId: number;

  @Column({
    default: 'default',
    name: 'source',
    comment: '来源渠道',
  })
  source: string;

  @Column({ name: 'sort', comment: '排序号', nullable: true })
  sort: number;

  @Column({
    name: 'status',
    comment: '状态：0关闭,1，开启',
    nullable: true,
    default: 0,
  })
  status: number;

  @Column({ name: 'remark', comment: '备注', nullable: true })
  remark: string;

  @Column({ name: 'user_id', comment: '更新人', nullable: true })
  userId: number;
}
